package com.zzyl.ai;/**
 * @author wl
 * @version 1.0
 * @since 2025-08-16 11:30
 */

import com.baidubce.qianfan.Qianfan;
import com.baidubce.qianfan.model.chat.ChatResponse;

/**
 *des:
 *data Created in 2025-08-16 11-30
 */
public class testAi {

    public static void main(String[] args) {
        // 使用安全认证AK/SK鉴权，替换下列示例中参数，安全认证Access Key替换your_iam_ak，Secret Key替换your_iam_sk，如何获取请查看https://cloud.baidu.com/doc/Reference/s/9jwvz2egb
        Qianfan qianfan = new Qianfan("ALTAK7MWu6LJBu9eNryhBaVk4d", "b99f3d88138b4232becfab4bf620bae9");


        // 指定模型
        ChatResponse resp = qianfan.chatCompletion()
//                .model("ERNIE-3.5-8K")
                .model("ERNIE-4.0-8K-Preview")
                .addMessage("user", "你好,请帮我随机出一个10以内加减法")
                .execute();
        System.out.println(resp.getResult());
    }

}
